local Mask = class("Mask")

local check = function(v,d)
	if v then
		return v
	else
		return d
	end
end

function Mask:read(value)
	self.uid = check(value.uid, self.uid)
	self.tid = check(value.tid, self.tid)
	self.partStates = check(value.partStates, self.partStates)
end


function Mask:write(value)
	value.uid = self.uid
	value.tid = self.tid
	value.partStates = self.partStates
end

function Mask:ctor()
	self.uid = ""
	self.tid= 0
	self.partStates = {}
end



return Mask